#ifndef _BUILDERFRAMEWORK_H
#define _BUILDERFRAMEWORK_H

#ifdef __cplusplus
extern "C"{
#endif

typedef enum
{
	BUILDER_START,				//
	BUILDER_TUNER_LOCK,		
	BUILDER_IN_PROCESS,		
	BUILDER_STAGE_FINISH,	
	BUILDER_END,
	BUILDER_NETWORK_UPDATE,
	BUILDER_SCAN_FINISH,
	BUILDER_DVB_INIT_FINISH,
	BUILDER_SCAN_IN_PROCESS,
	BUILDER_SCAN_START,
}BUILDER_CALLBACK_PROCESS_T;

typedef struct
{
	char				m_s8Name[100];
	unsigned char		m_u8ServiceType;
	unsigned char 	m_u8Encrypt;
	unsigned short 	m_u16ServiceId;
	unsigned short 	m_u16Lcn;
}builder_callback_service_t;

typedef struct
{
	unsigned int				m_u32Cnt;
	builder_callback_service_t* 	m_pstServices;
}builder_callback_service_info_t;

typedef enum
{
	BUILDER_ECODE_SUCCESS = 0,
	BUILDER_ECODE_FAILED,
}BUILDER_CALLBACK_ECODE_T;

typedef union
{
	builder_callback_service_info_t	m_stServiceInfo;
	unsigned int 					m_u32Process;
	dvb_tuner_status_t			m_stLockStatus;
	dvb_tuner_t					m_stTunerInfo;
	dvb_network_t				m_stNetworkInfo;
}builder_callback_param_u;

typedef struct
{
	BUILDER_CALLBACK_PROCESS_T	m_eStage;
	BUILDER_CALLBACK_ECODE_T		m_eErrorCode;
	builder_callback_param_u			m_uParam;
}builder_callback_param_t;

typedef void (*pfBuilderCallback)(builder_callback_param_t* pstParam);
typedef void (*pfBuilderPsiChangeCallback)(unsigned char u8UpdateType, dvb_service_t* ServiceHdID);

extern int DvbBuilderManualSearch(dvb_tuner_t* pstTunerInfo, pfBuilderCallback pfCallback);
extern int DvbBuilderNetworkSearch(dvb_tuner_t* pstTunerInfo,  pfBuilderCallback pfCallback);
extern int DvbBuilderFullSearch(dvb_tuner_t* pstStartTunerInfo, dvb_tuner_t* pstEndTunerInfo, pfBuilderCallback pfCallback);
extern int DvbBuilderAutoSearch(pfBuilderCallback pfCallback);
extern int DvbBuilderStopSearch();
extern int DvbBuilderBootUpdate(pfBuilderCallback pfCallback);
extern int DvbBuilderAcquaintance(pfBuilderCallback pfCallback);
extern int DvbBuilderLoadPlugin(const char* ps8Path);
extern int DvbBuilderUnloadPlugin();
extern int DvbBuilderInit(pfBuilderPsiChangeCallback pfCallBack);
extern int DvbBuilderMonitorSearchStart(dvb_tuner_t *pstTunerInfo, dvb_service_t *pstServiceData);
extern int DvbBuilderMonitorSearchStop();
extern int DvbBuilderMonitorInit();
extern int DvbBuilderGetPluginMagicId();
extern int DvbBuilderGetPluginDescriptor(char* ps8PluginDesc);
extern void DvbBuilderStopAcquaintance();

#ifdef __cplusplus
}
#endif

#endif //_BUILDERFRAMEWORK_H

